#include "AppDX9.h"
#include "AppDX10.h"
#include "Engine/AuxTypes.h"

CApplication  *g_pApp = NULL;
API_VERSION    g_ApiVersion;
UD3DDevice     g_D3DDevice;

CApplication* CApplication::Create( int a_iWidth, int a_iHeight, API_VERSION a_Ver )
{
    g_ApiVersion = a_Ver;
    switch ( a_Ver )
    {
    case V_D3D9: 
        g_pApp = new CAppDX9(a_iWidth, a_iHeight);
        g_D3DDevice.pD3D9Device = ((CAppDX9*)g_pApp)->GetD3DDevice();        
        break;
    case V_D3D10: 
        g_pApp = new CAppDX10(a_iWidth, a_iHeight);
        g_D3DDevice.pD3D10Device = ((CAppDX10*)g_pApp)->GetD3DDevice();
        break;
    default:
        g_pApp = NULL;
    }   

    return g_pApp;
}
